package iterator;

public class ChromeMenuIterator implements Iterator {
    MenuItem[] items;
    int cur;

    public ChromeMenuIterator(MenuItem[] items) {
        this.items = items;
    }

    @Override
    public boolean hasNext() {
        return cur < items.length && items[cur] != null;
    }

    @Override
    public MenuItem next() {
        return items[cur++];
    }
}
